package com.zb.frame.modules.monitor.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zb.frame.modules.monitor.enums.LogType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author bangZZ
 * @since 2020-06-09
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("monitor_log")
@ApiModel(value="Log对象", description="")
public class Log implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键Id")
    @TableId(value = "log_id", type = IdType.AUTO)
    private Long logId;

    @ApiModelProperty(value = "操作模块")
    private String logModule;

    @ApiModelProperty(value = "日志类型0-登录1-新增-2修改-3删除4-授权5-取消授权6-停用7-启用8-用户上锁9-用户解锁")
    private Integer logType;

    @ApiModelProperty(value = "旧数据")
    private String oldValue;

    @ApiModelProperty(value = "新数据")
    private String newValue;

    @ApiModelProperty(value = "关联的主键")
    private String relId;

    @ApiModelProperty(value = "批量标识")
    private Integer batchFlag;

    @ApiModelProperty(value = "恢复标识")
    private Integer returnFlag;

    @ApiModelProperty(value = "成功标识")
    private Integer okFlag;

    @ApiModelProperty(value = "失败原因")
    private String failMsg;

    @ApiModelProperty(value = "附加字段1 String")
    private String logExt1;

    @ApiModelProperty(value = "描述")
    private String logDesc;

    @ApiModelProperty(value = "操作人")
    private Long operator;

    @ApiModelProperty(value = "操作人登录账号")
    @TableField(exist = false)
    private String operatorName;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

}
